/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Fabian
 */
@Entity
@Table(name = "califica")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Califica.findAll", query = "SELECT c FROM Califica c"),
    @NamedQuery(name = "Califica.findByIdProyecto", query = "SELECT c FROM Califica c WHERE c.calificaPK.idProyecto = :idProyecto"),
    @NamedQuery(name = "Califica.findByPromedio", query = "SELECT c FROM Califica c WHERE c.promedio = :promedio"),
    @NamedQuery(name = "Califica.findByCedulaEvaluador", query = "SELECT c FROM Califica c WHERE c.calificaPK.cedulaEvaluador = :cedulaEvaluador"),
    @NamedQuery(name = "Califica.findByItem1", query = "SELECT c FROM Califica c WHERE c.item1 = :item1"),
    @NamedQuery(name = "Califica.findByItem2", query = "SELECT c FROM Califica c WHERE c.item2 = :item2"),
    @NamedQuery(name = "Califica.findByItem3", query = "SELECT c FROM Califica c WHERE c.item3 = :item3"),
    @NamedQuery(name = "Califica.findByItem4", query = "SELECT c FROM Califica c WHERE c.item4 = :item4"),
    @NamedQuery(name = "Califica.findByItem5", query = "SELECT c FROM Califica c WHERE c.item5 = :item5"),
    @NamedQuery(name = "Califica.findByItem6", query = "SELECT c FROM Califica c WHERE c.item6 = :item6"),
    @NamedQuery(name = "Califica.findByItem7", query = "SELECT c FROM Califica c WHERE c.item7 = :item7"),
    @NamedQuery(name = "Califica.findByItem8", query = "SELECT c FROM Califica c WHERE c.item8 = :item8"),
    @NamedQuery(name = "Califica.findByItem9", query = "SELECT c FROM Califica c WHERE c.item9 = :item9"),
    @NamedQuery(name = "Califica.findByItem10", query = "SELECT c FROM Califica c WHERE c.item10 = :item10")})
public class Califica implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected CalificaPK calificaPK;
    @Column(name = "promedio")
    private Integer promedio;
    @Column(name = "item_1")
    private String item1;
    @Column(name = "item_2")
    private String item2;
    @Column(name = "item_3")
    private String item3;
    @Column(name = "item_4")
    private String item4;
    @Column(name = "item_5")
    private String item5;
    @Column(name = "item_6")
    private String item6;
    @Column(name = "item_7")
    private String item7;
    @Column(name = "item_8")
    private String item8;
    @Column(name = "item_9")
    private String item9;
    @Column(name = "item_10")
    private String item10;
    @JoinColumn(name = "id_proyecto", referencedColumnName = "id_proyecto", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Proyecto proyecto;
    @JoinColumn(name = "cedula_evaluador", referencedColumnName = "cedula", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Evaluador evaluador;

    public Califica() {
    }

    public Califica(CalificaPK calificaPK) {
        this.calificaPK = calificaPK;
    }

    public Califica(String idProyecto, String cedulaEvaluador) {
        this.calificaPK = new CalificaPK(idProyecto, cedulaEvaluador);
    }

    public CalificaPK getCalificaPK() {
        return calificaPK;
    }

    public void setCalificaPK(CalificaPK calificaPK) {
        this.calificaPK = calificaPK;
    }

    public Integer getPromedio() {
        return promedio;
    }

    public void setPromedio(Integer promedio) {
        this.promedio = promedio;
    }

    public String getItem1() {
        return item1;
    }

    public void setItem1(String item1) {
        this.item1 = item1;
    }

    public String getItem2() {
        return item2;
    }

    public void setItem2(String item2) {
        this.item2 = item2;
    }

    public String getItem3() {
        return item3;
    }

    public void setItem3(String item3) {
        this.item3 = item3;
    }

    public String getItem4() {
        return item4;
    }

    public void setItem4(String item4) {
        this.item4 = item4;
    }

    public String getItem5() {
        return item5;
    }

    public void setItem5(String item5) {
        this.item5 = item5;
    }

    public String getItem6() {
        return item6;
    }

    public void setItem6(String item6) {
        this.item6 = item6;
    }

    public String getItem7() {
        return item7;
    }

    public void setItem7(String item7) {
        this.item7 = item7;
    }

    public String getItem8() {
        return item8;
    }

    public void setItem8(String item8) {
        this.item8 = item8;
    }

    public String getItem9() {
        return item9;
    }

    public void setItem9(String item9) {
        this.item9 = item9;
    }

    public String getItem10() {
        return item10;
    }

    public void setItem10(String item10) {
        this.item10 = item10;
    }

    public Proyecto getProyecto() {
        return proyecto;
    }

    public void setProyecto(Proyecto proyecto) {
        this.proyecto = proyecto;
    }

    public Evaluador getEvaluador() {
        return evaluador;
    }

    public void setEvaluador(Evaluador evaluador) {
        this.evaluador = evaluador;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (calificaPK != null ? calificaPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Califica)) {
            return false;
        }
        Califica other = (Califica) object;
        if ((this.calificaPK == null && other.calificaPK != null) || (this.calificaPK != null && !this.calificaPK.equals(other.calificaPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "modelo.Califica[ calificaPK=" + calificaPK + " ]";
    }
    
}
